#pragma once
//This class defines the interface for the XML parser API
#include "xmlnode.h"
#include "XMLParser.h"
#include "tree.hh"

class xml_document
{
public:
	// Loads an XML into XMLDocument object
	void load_from_string(const string & xml_string);

	// Loads an XML into XMLDocument object
	void load_from_file(const string & filename);

	// Returns the root node of the XMLDocument
	std::shared_ptr<xmlnode> get_root_node();

	// Just for debugging
	void debug_print();

	// DOM Methods

	// Returns all elements of a specific tag name.
	xmlnodes get_elements_by_tag_name(const std::string & tagstr);


	// Returns all elements given a specific id.
	xmlnodes get_elements_by_id(const std::string & instr);

private:
	// xmlparser pointer
	tree<std::shared_ptr<xmlnode>> m_tree;

};

